Patrick Irving, 5/19/2021
To enable fast and easy exploration of MaP experimental data.
Possible Names:
plotmapper.py can be found in the JNBTools repo on Github.
I'm happy to help with this. Also, the Weeks/Laederach software group is planning a meeting on setting up environments.
First option, work on your own PC:
Second option, work on Longleaf:
The first code cell of a notebook should define defaults and load in modules
For high-level plotting functions, you only need to import plotmapper. However, you will need several packages installed in your python environment:
# Display plots in-line
%matplotlib inline
# import modules
import plotmapper as MaP
import matplotlib.pyplot as plt
MaP.Sample is the core object in this package. For each MaP experimental sample, it holds the following information.
example1 = MaP.Sample(sample="example1",
profile = 'data/example1_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example1-rnasep.corrs',
pairs = 'data/example1-rnasep-pairmap.txt',
log = 'data/example1_shapemapper_log.txt',
dance_reactivities = 'data/example1_rnasep-reactivities.txt',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb',
pdb_name = '3dhs')
example2 = MaP.Sample(sample="example2",
profile = 'data/example2_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example2-rnasep.corrs',
pairs = 'data/example2-rnasep-pairmap.txt',
log = 'data/example2_shapemapper_log.txt',
dance_reactivities = 'data/example2_rnasep-reactivities.txt',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb',
pdb_name = '3dhs')
example3 = MaP.Sample(sample="example3",
profile = 'data/example3_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example3-rnasep.corrs',
pairs = 'data/example3-rnasep-pairmap.txt',
log = 'data/example3_shapemapper_log.txt',
dance_reactivities = 'data/example3_rnasep-reactivities.txt',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb',
pdb_name = '3dhs')
example4 = MaP.Sample(sample="example4",
profile = 'data/example4_rnasep_profile.txt',
ct = 'data/RNaseP.ct',
ss = 'data/RC_CRYSTAL_STRUCTURE.xrna',
rings = 'data/example4-rnasep.corrs',
pairs = 'data/example4-rnasep-pairmap.txt',
log = 'data/example4_shapemapper_log.txt',
dance_reactivities = 'data/example4_rnasep-reactivities.txt',
deletions = 'data/example-rnasep-deletions.txt',
fasta = 'data/RNaseP-noSC.fasta',
pdb = 'data/3dhs_Correct.pdb',
pdb_name = '3dhs')
path = 'data/'
def kwargs(sample):
kwargs = {"sample": sample
"profile": path+sample+"_rnasep_profile.txt",
"ct": path+"RNaseP.ct",
"ss": path+"RC_CRYSTAL_STRUCTURE.xrna",
"rings": path+sample+"-rnasep.corrs",
"pairs": path+sample+"-rnasep-pairmap.txt",
"log": path+sample+"_shapemapper_log.txt",
"dance_reactivities": path+sample+"_rnasep-reactivities.txt",
"deletions": path+"example-rnasep-deletions.txt",
"fasta": path+"RNaseP-noSC.fasta",
"pdb": path+"3dhs_Correct.pdb",
"pdb_name": "3dhs"}
return kwargs
example1 = MaP.Sample(**kwargs("example1"))
example2 = MaP.Sample(**kwargs("example2"))
example3 = MaP.Sample(**kwargs("example3"))
example4 = MaP.Sample(**kwargs("example4"))
example2.make_log_qc()
MaP.array_qc([example1, example2, example3, example4])
example2.plot_sm_profile()
example2.plot_sm_rates()
example2.plot_sm_depth()
example2.make_shapemapper()
example2.make_skyline()
MaP.array_skyline([example1, example2, example3, example4])
example2.make_dance_skyline()
fig, ax = plt.subplots(1, 2, figsize=(14, 7))
example2.make_heatmap("deletions", "pdb", ax=ax[0])
example2.make_heatmap("deletions", "ct", ax=ax[1])
example2.make_ap(attribute="deletions", Percentile=0.95);
MaP.array_ap([example1, example2, example3, example4], attribute="rings", cdAbove=15)
example2.make_ss(attribute="rings");
MaP.array_ss([example1, example2, example3, example4], attribute="pairs")
Controls:
example2.make_3d(attribute="deletions", metric="Distance", Percentile=0.99).spin()
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x1fc3dbca708>
MaP.array_3d([example1, example2, example3, example4], attribute="rings", Statistic=15)
You appear to be running in JupyterLab (or JavaScript failed to load for some other reason). You need to install the 3dmol extension:
jupyter labextension install jupyterlab_3dmol
<py3Dmol.view at 0x1fc3d8d4948>
PlotMapper and Jupyter Notebooks provides a fast and easy way to explore MaP and JuMP data sets.